import { post, get } from '../../http/axios'


export default {
    //命名空间
    namespaced: true,
    //状态 - data  存储响应结果、变量
    state: {
        dataList: {

        }
    },
    //突变   只能通过突变改变state中的变量值
    mutations: {
        set_dataList(state, dataList) {
            state.dataList = dataList;
        }
    },
    //动作   等价于methods,发送请求
    actions: {
        async saveOrUpdate(context, pramas) {
            let res = await post('/epidemic/saveOrUpdate', pramas);
            return res;
        },
        async page_query(context, params) {
            let res = await get('epidemic/pageQuery', params);
            context.commit('set_dataList', res.data)
        }
    }
}